
#include "MapRenderer.hpp"
#include "World/Tile.hpp"
#include "Render/TileRenderer.hpp"

MapRenderer::MapRenderer()
{
     Location location( 0, 0, 0 );
     boost::shared_ptr< Tile > tilePtr( new Tile( 0xFF00FF00, location ) );
     boost::shared_ptr< TileRenderer > tileRendererPtr( new TileRenderer( tilePtr ) );
     mRenderableVector.push_back( tileRendererPtr );
}

MapRenderer::~MapRenderer()
{
     mRenderableVector.clear();
}

void MapRenderer::RenderAll()
{
     if( !mRenderableVector.empty() )
     {
          for( auto renderIt = mRenderableVector.begin(); renderIt != mRenderableVector.end(); ++renderIt )
               (*renderIt)->Render();
     }
}